package com.nowcoder.code.hjnc;

public class NC22 {

    public void merge(int A[], int m, int B[], int n) {

        int ai = m - 1, bi = n - 1, i = m + n - 1;
        while (ai >= 0 && bi >= 0) {
            A[i--] = A[ai] < B[bi] ? B[bi--] : A[ai--];
        }
        while (bi >= 0) {
            A[i--] = B[bi--];
        }
    }

}
